package com.hqyj.controller;


import com.hqyj.exception.R;
import com.hqyj.pojo.UserInfo;
import com.hqyj.service.UserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author rock
 * @since 2022-12-07 05:14:05
 */
@RestController
@RequestMapping("/register")
public class UserInfoController {


    @Autowired
    UserInfoService userInfoService;

    //注册
    @PostMapping("/user")
    public R regist(@Valid UserInfo userInfo, BindingResult br)   {
        return userInfoService.regist(userInfo);
    }
}

